// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license


#include "stdafx.h"
#include "Ui.h"


Ui::Ui(World* world)
:   WorldFollower(WorldFollower::ListenNothing),
    m_actionManager(world, this),
    m_selectionManager(this)
{
    setWorld(world);
	addWorldFollower(&m_selectionManager);
}
 
Ui::~Ui()
{
}

SelectionManager& Ui::getSelectionManager()
{
    return m_selectionManager;
}

ActionManager& Ui::getActionManager()
{
    return m_actionManager;
}

LogManager& Ui::getLogManager()
{
    return m_logManager;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void Ui::addWorldFollower(WorldFollower* view)
{
    m_worldFollowers.insert(view);
    view->setWorld(&getWorld());
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void Ui::addUiFollower(UiFollower* view)
{
    m_uiFollowers.insert(view);
    view->setUi(this);
}

